package com.cskaoyan.mall.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class StringUtils {
    public static boolean isEmpty(String s) {
        if(s == null || "".equals(s.trim())){
            return true;
        }
        return false;
    }
    /**
     * 判断传来的字符串能否转化为整数或者小数
     * @param str
     * @return
     */
    public static boolean isNumeric(String str){
        Pattern pattern = Pattern.compile("[0-9]*\\.?[0-9]+");
        Matcher isNum = pattern.matcher(str);
        if (!isNum.matches()) {
            return false;
        }
        return true;
    }
}
